import { Module } from '@nestjs/common';
import { AuthService } from './auth.service';
import { AuthController } from './auth.controller';
import { JwtModule } from '@nestjs/jwt';
import { PassportModule } from '@nestjs/passport';
import { jwtConstants } from '../../constants/jwt.constant';
import { JwtStrategy } from './strategies/jwt.strategy';
import { DbModule } from '../../db/db.module';
import { RoleModule } from '../role/role.module';
import { PermissionModule } from '../permission/permission.module';
import { LoginLogModule } from '../login-log/login-log.module';
import { MenuModule } from '../menu/menu.module';

@Module({
  imports: [
    MenuModule,
    DbModule,
    RoleModule,
    // PermissionModule,
    LoginLogModule,
    PassportModule.register({ defaultStrategy: 'jwt' }),
    JwtModule.register({
      secret: jwtConstants.secret,
      signOptions: { expiresIn: jwtConstants.expiresIn },
    }),
  ],
  controllers: [AuthController],
  providers: [AuthService, JwtStrategy],
  exports: [AuthService],
})
export class AuthModule { } 